package com.rop.znyx.sys.controller;


import com.rop.znyx.common.result.Result;
import com.rop.znyx.model.sys.Region;
import com.rop.znyx.sys.service.RegionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 地区表 前端控制器
 * </p>
 *
 * @author rop
 * @since 2023-06-22
 */

@Api(tags = "地区管理")
@RestController
@RequestMapping("admin/sys/region")
@RequiredArgsConstructor

public class RegionController {

    private final RegionService regionService;

    /**
     * 根据区域关键字查询区域信息
     */
    @ApiOperation("根据区域关键字查询区域信息")
    @GetMapping("findRegionByKeyword/{keyword}")
    public Result<List<Region>> findRegionByKeyword(@PathVariable("keyword") String keyword) {
        return Result.ok(regionService.findRegionByKeyword(keyword));
    }
}

